﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using MySql.Data.MySqlClient;
using MySql.Data.Types;


namespace Gui.Functies.Project_keuzemenu
{
    public partial class Projectkeuzemenu : Form
    {
        //waarden van de ingelogde persoon
        int userID;
      

        //title en description voor home page
        string defaultTitle = "Welkom bij GrabCollab!";
        string defaultDescription = "Kies één van de projecten uit het menu om te beginnen";

        //hier komen title en description voor de projecten in
        string username;
        string password;
   
        int project;
         private int[] id;
         private string[] title;
         private string[] description;
         int projectAmount;
        public Projectkeuzemenu()
        {

        }

        public Projectkeuzemenu(int[] ids, string[] titles, string[] descriptions, int projectAantal)
        {
            id = ids;
            title = titles;
            description = descriptions;
            projectAmount = projectAantal;
            InitializeComponent();
            
            labelTitle.Text = defaultTitle;
            labelDescription.Text = defaultDescription;
            btnStart.Hide();

            switch (projectAmount)
            {
                case 1:
                    btnProject1.Show();
                    btnProject2.Hide();
                    btnProject3.Hide();
                    btnProject4.Hide();
                    btnProject5.Hide();
                    break;
                case 2:
                    btnProject1.Show();
                    btnProject2.Show();
                    btnProject3.Hide();
                    btnProject4.Hide();
                    btnProject5.Hide();
                    break;
                case 3:
                    btnProject1.Show();
                    btnProject2.Show();
                    btnProject3.Show();
                    btnProject4.Hide();
                    btnProject5.Hide();
                    break;
                case 4:
                    btnProject1.Show();
                    btnProject2.Show();
                    btnProject3.Show();
                    btnProject4.Show();
                    btnProject5.Hide();
                    break;
                case 5:
                    btnProject1.Show();
                    btnProject2.Show();
                    btnProject3.Show();
                    btnProject4.Show();
                    btnProject5.Show();
                    break;
            }
        }

        private void btnHome_Click_1(object sender, EventArgs e)
        {
              labelTitle.Text = defaultTitle;
            labelDescription.Text = defaultDescription;
            btnStart.Hide();
        }

        private void btnProject1_Click_1(object sender, EventArgs e)
        {
            project = id[0];
            labelTitle.Text = title[0];
            labelDescription.Text = description[0];
            btnStart.Show();
        }

        private void btnProject2_Click_1(object sender, EventArgs e)
        {
            project = id[1];
            labelTitle.Text = title[1];
            labelDescription.Text = description[1];
            btnStart.Show();
        }

        private void btnProject3_Click_1(object sender, EventArgs e)
        {
            project = id[2];
            labelTitle.Text = title[2];
            labelDescription.Text = description[2];
            btnStart.Show();
        }

        private void btnProject4_Click_1(object sender, EventArgs e)
        {
            project = id[3];
            labelTitle.Text = title[3];
            labelDescription.Text = description[3];
            btnStart.Show();
        }

        private void btnProject5_Click_1(object sender, EventArgs e)
        {
            project = id[4];
            labelTitle.Text = title[4];
            labelDescription.Text = description[4];
            btnStart.Show();
        }

        private void btnStart_Click(object sender, EventArgs e)
        {
            //GUI launchen met correcte variabelen
            this.Dispose(false);
             Gui.Interface gui = new Gui.Interface(project, userID, id, title, description, projectAmount);
            gui.Show();
        }
    }
}
